package com.etc.dao.impl;

import javax.annotation.Resource;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.etc.dao.UsersDao;
import com.etc.entity.Users;

@Repository(value = "usersDao")
public class UsersDaoImpl implements UsersDao {

	// spring容器传过来的可以直接注入
	@Resource
	private JdbcTemplate jdbcTemplate;

	@Resource(name = "users")
	private Users users;

	@Override
	public Users adduser(Users user) {
		// TODO Auto-generated method stub
		String sql = "insert into users values(10,?,?,?,?,?,?,?)";
		jdbcTemplate.update(sql, users.getuName(), users.getuPassword(), users.getuSex(), users.getuPhone(),
				users.getuBirthday(), users.getuAddress(), users.getuStatus());
		return null;
	}

}
